<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
   
    <link href="../bootstrap-3.3.7-dist/css/bootstrap-switch.css" rel="stylesheet">
    <script src="../jquery/jquery-3.3.1.min.js"></script>
    <script src="../bootstrap-3.3.7-dist/js/bootstrap-switch.js"></script>
</head>
<body>

    <input class="push" name="status" type="checkbox" checked="checked" data-on-text="开锁" data-off-text="关锁" data-off-color="warning" data-on-color="success">
    <input class="push" name="status" type="checkbox" checked="checked" data-on-text="开锁" data-off-text="关锁" data-off-color="warning" data-on-color="success">
<script type="text/javascript"> 
$(document).ready(function(){  
    $('[name="status"]').bootstrapSwitch({
        onSwitchChange:function(event,state){  
            alert(state);
    }  
    });
});
</script> 
</body>
</html>